package com.lagou.controller;

import com.lagou.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author czq
 * @date 2020/9/15 17:11
 */
@RestController
@RequestMapping("/api/email")
public class EmailController {

    @Autowired
    private EmailService emailService;

    /**
     * 发送验证码到邮箱，true成功，false失败
     */
    @GetMapping("/email/{email}/{code}")
    public boolean email(@PathVariable("email") String email, @PathVariable("code") String code) {
        return emailService.email(email, code);
    }
}
